Skip to content

Conversation

@rboy1
Copy link
Contributor

@rboy1 rboy1 commented Oct 1, 2025

~20% performance improvement, significant improvement when parsing large INI files

rboy1 and others added 5 commits October 1, 2025 18:47
~20% performance improvement, significant improvement when parsing large INI files
Creating HashSet is expensive when reading large file, since the validCommentChars do not change over the course of a single read API, initialize it once and use to to read entire file. Improves performance by about 15%
@cdervis cdervis merged commit f0afee9 into cdervis:main Oct 25, 2025
1 check passed
@cdervis
Copy link
Owner

cdervis commented Oct 25, 2025

Thanks for your contribution. I changed the ValidCommentChars property to be a HashSet, instead of instantiating it in every parse. This is fine, because version 4.0 will have API-breaking changes anyway. This way, some other code portions can profit from the fast char lookup.

@rboy1
Copy link
Contributor Author

rboy1 commented Oct 25, 2025

This is critical path when loading a very large INI. HashSet is slower in comparison in my testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants